From: Ævar Arnfjörð Bjarmason Date: Wed, 25 May 2005 04:09:33 +0000 (+0000) Subject: * Using $wgLang->getLanguageNames() rather than getting the language names X-Git-Tag: 1.5.0alpha2~85 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=70cc1d68d56dcc8b0611434539eed8189e2b445f;p=lhc%2Fweb%2Fwiklou.git * Using $wgLang->getLanguageNames() rather than getting the language names directly by including languages/Names.php --- diff --git a/includes/SpecialPreferences.php b/includes/SpecialPreferences.php index f34d8e59a7..a689052f40 100644 --- a/includes/SpecialPreferences.php +++ b/includes/SpecialPreferences.php @@ -8,9 +8,6 @@ if( !defined( 'MEDIAWIKI' ) ) die(); -/** to get a list of languages in setting user's language preference */ -require_once('languages/Names.php'); - /** * Entry point that create the "Preferences" object */ @@ -383,7 +380,7 @@ class PreferencesForm { function mainPrefsForm( $err ) { global $wgUser, $wgOut, $wgLang, $wgContLang, $wgValidSkinNames; global $wgAllowRealName, $wgImageLimits, $wgThumbLimits; - global $wgLanguageNames, $wgDisableLangConversion; + global $wgDisableLangConversion; global $wgEnotifWatchlist, $wgEnotifUserTalk,$wgEnotifMinorEdits; global $wgRCShowWatchingUsers, $wgEnotifRevealEditorAddress; global $wgEnableEmail, $wgEnableUserEmail, $wgEmailAuthentication; @@ -490,9 +487,10 @@ class PreferencesForm { * Otherwise, no default is selected and the user ends up * with an Afrikaans interface since it's first in the list. */ - $selectedLang = isset( $wgLanguageNames[$this->mUserLanguage] ) ? $this->mUserLanguage : $wgContLanguageCode; + $languages = $wgLang->getLanguageNames(); + $selectedLang = isset( $languages[$this->mUserLanguage] ) ? $this->mUserLanguage : $wgContLanguageCode; $selbox = null; - foreach($wgLanguageNames as $code => $name) { + foreach($languages as $code => $name) { global $IP; /* only add languages that have a file */ $langfile="$IP/languages/Language".str_replace('-', '_', ucfirst($code)).".php"; @@ -509,7 +507,7 @@ class PreferencesForm { foreach($variants as $v) { $v = str_replace( '_', '-', strtolower($v)); - if($name = $wgLanguageNames[$v]) { + if($name = $languages[$v]) { $variantArray[$v] = $name; } }